

package com.kimo.shop.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.kimo.shop.bean.model.OrderSettlement;
import com.kimo.shop.dao.OrderSettlementMapper;
import com.kimo.shop.service.OrderSettlementService;

import java.util.List;

/**
 *
 * @author kimo-taozhouchuan on 2018/11/10.
 */
@Service
public class OrderSettlementServiceImpl extends ServiceImpl<OrderSettlementMapper, OrderSettlement> implements OrderSettlementService {

    @Autowired
    private OrderSettlementMapper orderSettlementMapper;

	@Override
	public void updateSettlementsByPayNo(String outTradeNo, String transactionId) {
		orderSettlementMapper.updateSettlementsByPayNo(outTradeNo, transactionId);
	}

    @Override
    public List<OrderSettlement> listByOrderNumbers(List<String> orderNumbers) {
        return orderSettlementMapper.listByOrderNumbers(orderNumbers);
    }

    @Override
    public boolean updateBizOrderIdByPayno(String payNo, String orderId) {
        return this.update(new LambdaUpdateWrapper<OrderSettlement>()
                .set(OrderSettlement::getBizOrderNo,orderId)
                .eq(OrderSettlement::getPayNo,payNo));
    }
}
